package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class DeleteOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        if(bookList.getUsedSize() == 0) {
            System.out.println("目前暂时没有图书，请稍后过来查看...");
            return;
        }
        System.out.println("删除图书...");
        Scanner in = new Scanner(System.in);
        System.out.println("请输入要删除的书名：");
        String name = in.nextLine();
        if(bookList.delBookOfName(name) == null) {
            System.out.println("未找到...");
        } else {
            System.out.println("删除成功！！！");
        }
    }
}
